﻿/***********************************************************************
 * CLR 版本: 4.0.30319.225
 * 工程名称: $projectname$
 * 命名空间: Toulr.Services
 * 文件名称: IShopService
 * 描    述: 提供店铺信息管理、维护相关服务接口
 * 作    者: 18901309129@189.cn
 * 登录用户: hyyu
 * 创建时间: 2011-5-28 12:48:09
 * 创建年份: 2011
 * Update History: 
 ***********************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Toulr.Domains.Business;
using Toulr.Domains.System;
using Toulr.Models;
using Toulr.Models.Account;
using Toulr.Models.Shop;

namespace Toulr.Services
{
    /// <summary>
    /// IShopService 的摘要说明。
    /// </summary>
    public interface IShopService
    {
        // todo 还缺少根据店铺状态进行店铺检索 抢注店铺以及除店铺基本维护外的业务逻辑

        #region 店铺分享
        /// <summary>
        /// 分享店铺 在数据库中添加一次分享
        /// </summary>
        /// <param name="shop">
        /// 店铺对象，注意店铺ID不能为空
        /// </param>
        /// <returns>
        /// 分享总次数
        /// </returns>
        /// hyyu 20110609
        ActionResult<int> ShopShareIn(Shop shop);

        /// <summary>
        /// 分享店铺 在数据库中添加一次分享
        /// </summary>
        /// <param name="shopId">
        /// 店铺ID
        /// </param>
        /// <returns>
        /// 分享总次数
        /// </returns>
        /// hyyu 20110609
        ActionResult<int> ShopShareIn(int shopId);

        /// <summary>
        /// 获取店铺被分享次数
        /// </summary>
        /// <param name="shopId">
        /// 店铺ID
        /// </param>
        /// <returns></returns>
        /// hyyu 20110610
        ActionResult<int> GetShopShareInCount(int shopId);

        /// <summary>
        /// 获取店铺被分享次数
        /// </summary>
        /// <param name="shop">
        /// 店铺对象，注意店铺ID不能为空
        /// </param>
        /// <returns></returns>
        /// hyyu 20110610
        ActionResult<int> GetShopShareInCount(Shop shop);

        #endregion

        #region 店铺的评论与回复

        /// <summary>
        /// 获取店铺评论（分）详细内容列表
        /// </summary>
        /// <param name="shopId">店铺ID</param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<IList<ShopEvaluationDetail>> GetShopEvaluationDetails(int shopId);

        /// <summary>
        /// 获取店铺评论（分）详细内容列表
        /// </summary>
        /// <param name="shop">店铺对象</param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<IList<ShopEvaluationDetail>> GetShopEvaluationDetails(Shop shop);

        /// <summary>
        /// 添加店铺的一个评论（分）
        /// </summary>
        /// <param name="evaluationDetail">
        /// 评论对象
        /// 注意：添加完成后，会自动重新计算当前店铺汇总分
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopEvaluationDetail> AddShopEvaluationDetail(ShopEvaluationDetail evaluationDetail);

        /// <summary>
        /// 修改店铺一个的评论（分） 
        /// </summary>
        /// <param name="evaluationDetail">
        /// 评论对象
        /// 注意：
        /// 1.若某个属性未发生改变，应该将原有的值赋给属性
        /// 2.修改完成后，不会自动重新计算店铺汇总
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopEvaluationDetail> UpdateShopEvaluationDetail(ShopEvaluationDetail evaluationDetail);

        /// <summary>
        /// 删除店铺一个的评论（分）
        /// </summary>
        /// <param name="evaluationDetail">
        /// 评论对象
        /// 注意：删除一个评论后，会自动重新计算店铺的汇总分
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopEvaluationDetail> DeleteShopEvaluationDetail(ShopEvaluationDetail evaluationDetail);

        /// <summary>
        /// 删除店铺一个的评论（分）
        /// </summary>
        /// <param name="id">
        /// 评论对象ID
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopEvaluationDetail> DeleteShopEvaluationDetail(int id);

        /// <summary>
        /// 获取店铺某个评论的所有回复
        /// </summary>
        /// <param name="shopEvaluationDetail">评论对象</param>
        /// <returns></returns>
        /// hyyu 20110602
        ActionResult<IList<EvaluationReply>> GetEvaluationReplys(ShopEvaluationDetail shopEvaluationDetail);

        /// <summary>
        /// 获取店铺的所有评论回复
        /// </summary>
        /// <param name="shop">店铺对象</param>
        /// <returns></returns>
        /// hyyu 20110602
        ActionResult<IList<EvaluationReply>> GetEvaluationReplys(Shop shop);

        /// <summary>
        /// 添加一个评论的回复
        /// </summary>
        /// <param name="evaluationReply">
        /// 评论回复对象
        /// 注意ID为标识列并且下列字段不能为空
        /// ShopEvaluationDetailId
        /// UserId
        /// ReplyContext
        /// </param>
        /// <returns></returns>
        /// hyyu 20110602
        ActionResult<EvaluationReply> AddEvaluationReply(EvaluationReply evaluationReply);

        /// <summary>
        /// 修改店铺评论回复内容
        /// </summary>
        /// <param name="evaluationReplyId">回复对象ID</param>
        /// <param name="replyContext">回复内容</param>
        /// <returns></returns>
        /// hyyu 20110602
        ActionResult<EvaluationReply> UpdateEvaluationReply(int evaluationReplyId, string replyContext);

        /// <summary>
        /// 修改店铺评论回复
        /// </summary>
        /// <param name="evaluationReply">
        /// 回复对象
        /// 注意若某个属性未发生改变，应该将原有的值赋给属性
        /// </param>
        /// <returns></returns>
        /// hyyu 20110602
        ActionResult<EvaluationReply> UpdateEvaluationReply(EvaluationReply evaluationReply);

        /// <summary>
        /// 删除店铺评论回复
        /// </summary>
        /// <param name="evaluationReply">
        /// 回复对象
        /// </param>
        /// <returns></returns>
        /// hyyu 20110602
        ActionResult<EvaluationReply> DeleteEvaluationReply(EvaluationReply evaluationReply);

        /// <summary>
        /// 添加对一个评论的支持（我认为不错）
        /// </summary>
        /// <param name="evaluationDetailId">
        /// 评论ID
        /// </param>
        /// <returns></returns>
        /// hyyu20110611
        ActionResult<int> AddShopEvaluationAbet(int evaluationDetailId);

        /// <summary>
        /// 添加对一个评论的支持（我认为不错）
        /// </summary>
        /// <param name="evaluationDetail">
        /// 评论对象
        /// 注意ID不能为空
        /// </param>
        /// <returns></returns>
        /// hyyu20110611
        ActionResult<int> AddShopEvaluationAbet(ShopEvaluationDetail evaluationDetail);

        #endregion

        #region 店铺所属分类扩展特性维护

        /// <summary>
        /// 获取店铺可选的扩展属性列表 用于初始化用户输入界面
        /// </summary>
        /// <param name="shop"></param>
        /// <returns></returns>
        /// hyyu 20110528
        ActionResult<IList<InfoCategoriesProperty>> GetOptionalPropertys(Shop shop);

        /// <summary>
        /// 获取分类信息可选的扩展属性列表 用于初始化用户输入界面
        /// </summary>
        /// <param name="infoCategoriesId"></param>
        /// <returns></returns>
        /// hyyu 20110528 
        ActionResult<IList<InfoCategoriesProperty>> GetOptionalPropertys(int infoCategoriesId);

        /// <summary>
        /// 获取当前店铺已有的分类扩展属性、属性值列表 用于界面显示
        /// </summary>
        /// <param name="shopId"></param>
        /// <returns></returns>
        /// hyyu 20110528 
        ActionResult<IList<ShopProperty>> GetShopPropertys(int shopId);

        /// <summary>
        /// 获取店铺可选的评分项列表 用于初始化用户输入界面
        /// </summary>
        /// <param name="shop"></param>
        /// <returns></returns>
        /// hyyu 20110608
        ActionResult<IList<InfoCategoriesProperty>> GetOptionalEvaluation(Shop shop);

        /// <summary>
        /// 获取店铺可选的评分项列表 用于初始化用户输入界面
        /// </summary>
        /// <param name="infoCategoriesId"></param>
        /// <returns></returns>
        /// hyyu 20110608
        ActionResult<IList<InfoCategoriesProperty>> GetOptionalEvaluation(int infoCategoriesId);

        /// <summary>
        /// 添加一个店铺的扩展属性信息
        /// </summary>
        /// <param name="shopProperty">
        /// 扩展属性对象
        /// 注意：除ID外任何字段都不能为空
        /// </param>
        /// <returns></returns>
        /// hyyu 20110528 
        ActionResult<ShopProperty> AddShopProperty(ShopProperty shopProperty);

        /// <summary>
        /// 添加一组店铺的扩展属性信息
        /// </summary>
        /// <param name="shopPropertys">
        /// 扩展属性对象列表
        /// 注意：每个对象除ID外任何字段都不能为空
        /// </param>
        /// <returns>
        /// ActionResult.Result为保存成功的对象列表
        /// </returns>
        /// hyyu 20110528 
        ActionResult<IList<ShopProperty>> AddShopProperty(IList<ShopProperty> shopPropertys);

        /// <summary>
        /// 更新一个店铺的扩展属性信息
        /// </summary>
        /// <param name="shopProperty">
        /// 扩展属性对象
        /// 注意：若某个属性未发生改变，应该将原有的值赋给属性
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopProperty> UpdateShopProperty(ShopProperty shopProperty);

        /// <summary>
        /// 获取店铺汇总评分值 用于界面显示
        /// </summary>
        /// <param name="shop">
        /// 店铺对象
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopEvaluation> GetShopEvaluation(Shop shop);

        /// <summary>
        /// 获取店铺汇总评分值列表 用于界面显示
        /// </summary>
        /// <param name="shopId">
        /// 店铺ID
        /// </param>
        /// <returns></returns>
        /// hyyu 20110529 
        ActionResult<ShopEvaluation> GetShopEvaluation(int shopId);

        #endregion

        #region 店铺维护

        /// <summary>
        /// 获取店铺列表
        /// </summary>
        /// <returns></returns>
        /// hyyu 20110518
        ActionResult<IList<Shop>> GetShops();

        /// <summary>
        /// 获取店铺列表
        /// </summary>
        /// <param name="shop">
        /// 店铺对象
        /// 注意，这里并不是根据shop.Id进行查询，而是使用shop对象任意不为默认值的属性进行查询
        /// </param>
        /// <returns></returns>
        /// hyyu 20110518
        ActionResult<IList<Shop>> GetShops(Shop shop);

        /// <summary>
        /// 添加一个店铺
        /// </summary>
        /// <param name="shop">
        /// 店铺对象
        /// 注意：下列字段不能为空
        /// ShopName、ShopCategoryId、Description、Address、CityId
        /// </param>
        /// <returns></returns>
        /// hyyu 20110518
        ActionResult<Shop> AddShop(Shop shop);

        /// <summary>
        /// 修改店铺信息
        /// </summary>
        /// <param name="shop">店铺实体对象 注意：不需要修改的字段，应该将原有值赋与属性，否则修改为NULL值</param>
        /// <returns></returns>
        /// hyyu 20110518
        ActionResult<Shop> UpdateShop(Shop shop);

        /// <summary>
        /// 删除店铺信息 
        /// </summary>
        /// <param name="shop">
        /// 店铺对象
        /// 注意：目前仅删除店铺信息，没有做相关信息的级联删除。
        /// </param>
        /// <returns></returns>
        /// hyyu 20110518
        ActionResult<Shop> DeleteShop(Shop shop);

        /// <summary>
        /// 获取附近同类别热门店铺
        /// </summary>
        /// <param name="shopId">店铺ID</param>
        /// <param name="range">
        /// 半径范围 米
        /// </param>
        /// <param name="count">
        /// 要返回的店铺数量 按店铺被分享次数、评论次数降序排序
        /// </param>
        /// <returns></returns>
        /// hyyu 20110614
        ActionResult<IList<HotShopModel>> GetAboutHotShops(int shopId, int range,int count);

        /// <summary>
        /// 获取附近同类别热门店铺
        /// </summary>
        /// <param name="shop">
        /// 店铺对象 ID和ShopCategoryId Longitude Latitude必须正确
        /// </param>
        /// <param name="range">
        /// 半径范围 米
        /// </param>
        /// <param name="count">
        /// 要返回的店铺数量 按店铺被分享次数、评论次数降序排序
        /// </param
        /// <returns></returns>
        /// hyyu 20110614
        ActionResult<IList<HotShopModel>> GetAboutHotShops(Shop shop, int range,int count);

        #endregion

    }
}
